package com.hang.ad.service.impl;

import com.hang.ad.dao.AdCreativeDao;
import com.hang.ad.entity.AdCreative;
import com.hang.ad.service.ICreativeService;
import com.hang.ad.vo.CreativeRequest;
import com.hang.ad.vo.CreativeResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CreativeServiceImpl implements ICreativeService {
    @Autowired
    private AdCreativeDao adCreativeDao;

    @Override
    public CreativeResponse createCreative(CreativeRequest request) {
        AdCreative result = adCreativeDao.save(request.convert2Entity());

        return new CreativeResponse(result.getId(),result.getName());
    }
}
